package edu.upf.grupE.Entities;

/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 1.1.2.1</a>, using an XML
 * Schema.
 * $Id$
 */

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

/**
 * Class Area.
 * 
 * @version $Revision$ $Date$
 */
public class Area implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _x1.
     */
    private int _x1;

    /**
     * keeps track of state for field: _x1
     */
    private boolean _has_x1;

    /**
     * Field _y1.
     */
    private int _y1;

    /**
     * keeps track of state for field: _y1
     */
    private boolean _has_y1;

    /**
     * Field _x2.
     */
    private int _x2;

    /**
     * keeps track of state for field: _x2
     */
    private boolean _has_x2;

    /**
     * Field _y2.
     */
    private int _y2;

    /**
     * keeps track of state for field: _y2
     */
    private boolean _has_y2;

    /**
     * Field _textDescription.
     */
    private TextDescription _textDescription;


      //----------------/
     //- Constructors -/
    //----------------/

    public Area() {
        super();
    }


      //-----------/
     //- Methods -/
    //-----------/

    /**
     */
    public void deleteX1(
    ) {
        this._has_x1= false;
    }

    /**
     */
    public void deleteX2(
    ) {
        this._has_x2= false;
    }

    /**
     */
    public void deleteY1(
    ) {
        this._has_y1= false;
    }

    /**
     */
    public void deleteY2(
    ) {
        this._has_y2= false;
    }

    /**
     * Returns the value of field 'textDescription'.
     * 
     * @return the value of field 'TextDescription'.
     */
    public TextDescription getTextDescription(
    ) {
        return this._textDescription;
    }

    /**
     * Returns the value of field 'x1'.
     * 
     * @return the value of field 'X1'.
     */
    public int getX1(
    ) {
        return this._x1;
    }

    /**
     * Returns the value of field 'x2'.
     * 
     * @return the value of field 'X2'.
     */
    public int getX2(
    ) {
        return this._x2;
    }

    /**
     * Returns the value of field 'y1'.
     * 
     * @return the value of field 'Y1'.
     */
    public int getY1(
    ) {
        return this._y1;
    }

    /**
     * Returns the value of field 'y2'.
     * 
     * @return the value of field 'Y2'.
     */
    public int getY2(
    ) {
        return this._y2;
    }

    /**
     * Method hasX1.
     * 
     * @return true if at least one X1 has been added
     */
    public boolean hasX1(
    ) {
        return this._has_x1;
    }

    /**
     * Method hasX2.
     * 
     * @return true if at least one X2 has been added
     */
    public boolean hasX2(
    ) {
        return this._has_x2;
    }

    /**
     * Method hasY1.
     * 
     * @return true if at least one Y1 has been added
     */
    public boolean hasY1(
    ) {
        return this._has_y1;
    }

    /**
     * Method hasY2.
     * 
     * @return true if at least one Y2 has been added
     */
    public boolean hasY2(
    ) {
        return this._has_y2;
    }

    /**
     * Method isValid.
     * 
     * @return true if this object is valid according to the schema
     */
    public boolean isValid(
    ) {
        try {
            validate();
        } catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    }

    /**
     * 
     * 
     * @param out
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void marshal(
            final java.io.Writer out)
    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
        Marshaller.marshal(this, out);
    }

    /**
     * 
     * 
     * @param handler
     * @throws java.io.IOException if an IOException occurs during
     * marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     */
    public void marshal(
            final org.xml.sax.ContentHandler handler)
    throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
        Marshaller.marshal(this, handler);
    }

    /**
     * Sets the value of field 'textDescription'.
     * 
     * @param textDescription the value of field 'textDescription'.
     */
    public void setTextDescription(
            final TextDescription textDescription) {
        this._textDescription = textDescription;
    }

    /**
     * Sets the value of field 'x1'.
     * 
     * @param x1 the value of field 'x1'.
     */
    public void setX1(
            final int x1) {
        this._x1 = x1;
        this._has_x1 = true;
    }

    /**
     * Sets the value of field 'x2'.
     * 
     * @param x2 the value of field 'x2'.
     */
    public void setX2(
            final int x2) {
        this._x2 = x2;
        this._has_x2 = true;
    }

    /**
     * Sets the value of field 'y1'.
     * 
     * @param y1 the value of field 'y1'.
     */
    public void setY1(
            final int y1) {
        this._y1 = y1;
        this._has_y1 = true;
    }

    /**
     * Sets the value of field 'y2'.
     * 
     * @param y2 the value of field 'y2'.
     */
    public void setY2(
            final int y2) {
        this._y2 = y2;
        this._has_y2 = true;
    }

    /**
     * Method unmarshal.
     * 
     * @param reader
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @return the unmarshaled Area
     */
    public static Area unmarshal(
            final java.io.Reader reader)
    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
        return (Area) Unmarshaller.unmarshal(Area.class, reader);
    }

    /**
     * 
     * 
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void validate(
    )
    throws org.exolab.castor.xml.ValidationException {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    }

}
